package com.hd.trans.config

import com.hd.trans.common.Products

class TranslationProperty private constructor() {
    var appName: String = Products.APP_NAME
    var appPackageName: String? = null
    var appVersionName: String = Products.versionName //应用版本号
    var appVersion: Int = 0
    var productId: String = Products.PRODUCT_ID //产品信息
    var productInfo: String = Products.PRODUCT_INFO //产品信息
    var androidId: String? = null
    var productCredits: String = Products.creditsCode
    var channel: String = "HuaWei" //渠道
    var disableLanguages: List<String> = ArrayList() //禁用语言code列表


    class Builder {
        private val property = TranslationProperty()
        fun build(): TranslationProperty {
            return property
        }

        /**
         * AppName
         */
        fun setAppName(appName: String): Builder {
            property.appName = appName
            return this
        }
        /**
         * 应用包名
         */
        fun setAppPackageName(appPackageName: String): Builder {
            property.appPackageName = appPackageName
            return this
        }
        /**
         * 应用版本号
         */
        fun setAppVersionName(appVersionName: String): Builder {
            property.appVersionName = appVersionName
            return this
        }
        /**
         * 应用版本
         */
        fun setAppVersion(appVersion: Int): Builder {
            property.appVersion = appVersion
            return this
        }
        /**
         * 产品ID
         */
        fun setProductId(productId: String): Builder {
            property.productId = productId
            return this
        }
        /**
         * 产品信息
         */
        fun setProductInfo(productInfo: String): Builder {
            property.productInfo = productInfo
            return this
        }
        /**
         * androidId
         */
        fun setAndroidId(androidId: String): Builder {
            property.androidId = androidId
            return this
        }
        /**
         * 产品Credits
         */
        fun setProductCredits(productCredits: String): Builder {
            property.productCredits = productCredits
            return this
        }
        /**
         * 渠道
         */
        fun setChannel(channel: String): Builder {
            property.channel = channel
            return this
        }
        /**
         * 禁用语言
         */
        fun setDisableLanguages(disableLanguages: List<String>): Builder {
            property.disableLanguages = disableLanguages
            return this
        }
    }
}